﻿using Api.WDS.Operate;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace Api.WDS.Controllers
{
    [Route("api/[controller]")]
    [ApiController]
    public class LatestController : ControllerBase
    {
        /// <summary>
        /// 获取全部消息集合
        /// </summary>
        /// <returns></returns>
        [HttpGet("GetAllNotify")]
        public IActionResult GetAllNotify()
        {
            var token = HttpContext.Request.Query["Token"];

            return Ok(new LatestOp().GetUserAllNotify(token));
        }

        /// <summary>
        /// 获取用户点赞集合
        /// </summary>
        /// <returns></returns>
        [HttpGet("GetLike")]
        public IActionResult GetLike()
        {
            var token = HttpContext.Request.Query["Token"];

            return Ok(new LatestOp().GetUserLatestLike(token));
        }

        /// <summary>
        /// 清空用户最新点赞
        /// </summary>
        /// <returns></returns>
        [HttpGet("DelLike")]
        public IActionResult DelLike()
        {
            var token = HttpContext.Request.Query["Token"];

            return Ok(new LatestOp().DelLatestLike(token));
        }

        /// <summary>
        /// 清空用户最新评论
        /// </summary>
        /// <returns></returns>
        [HttpGet("DelComment")]
        public IActionResult DelComment()
        {
            var token = HttpContext.Request.Query["Token"];

            return Ok(new LatestOp().DelLatestComment(token));
        }

        /// <summary>
        /// 清空用户最新消息
        /// </summary>
        /// <returns></returns>
        [HttpGet("DelMessage")]
        public IActionResult DelMessage()
        {
            var token = HttpContext.Request.Query["Token"];

            return Ok(new LatestOp().DelLatestMessage(token));
        }
    }
}
